using UnityEngine;

public class VehiclesManager : MonoBehaviour
{
	public static VehiclesManager Instance;

	public VehiclesCreatePlayer vehicles_;

	public int indexVehicles = -1;

	private void Awake()
	{
		Instance = this;
	}

	public VehiclesMovement create_vehiclesMovement()
	{
		return vehicles_._Player(indexVehicles).GetComponent<VehiclesMovement>();
	}

	public void ChangeVehicle(string name)
	{
		indexVehicles = _GetIndex(name);
		PlayerControlManager.Instance.isVehicles = true;
		PlayerControlManager.Instance.click_Reset();
	}

	private int _GetIndex(string s)
	{
		switch (s)
		{
		case "SUPER CART":
			return 0;
		case "POWER SEAT":
			return 1;
		case "KID SCOOTER":
			return 2;
		case "HOSPITAL BED":
			return 3;
		case "HOVERBOARD":
			return 4;
		case "MOTOR BIKE":
			return 5;
		case "JEEP SUVS":
			return 6;
		case "SPORT BIKE":
			return 7;
		case "ROADSTER":
			return 9;
		case "JEEP BOMBS":
			return 8;
		case "BULLDOZERS":
			return 10;
		default:
			return 0;
		}
	}
}
